package com.sumainfor.pc.market.service.Feign;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.market.dao.feign.PactMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 功能描述:
 * 合同
 *
 * @Auther: zhlu
 * @Date: 2019/6/17 19:34
 * @Description:
 */
@Service
public class PactService {

    @Autowired
    PactMapper PactMapper;

    /**
     * 功能描述:
     * 获取所有的合同列表
     *
     * @Author zhlu
     * @Description //TODO
     * @Date 2019/6/17 19:35
     */
    public List<Map<String, Object>> getAllPactList() {
        return PactMapper.getAllPactList();
    }

    /**
     * 功能描述:
     * 根据合同编号获取合同资料
     *
     * @Author zhlu
     * @Description //TODO
     * @Date 2019/7/3 5:24
     */
    public Map<String, Object> getPactByPaIdMap(Map<String, Object> params) {
        return PactMapper.getPactByPaIdMap(params);
    }

    /**
     * 功能描述:
     * 根据租客编号和合同编号获取租客合同资料
     *
     * @Author zhlu
     * @Description //TODO
     * @Date 2019/7/11 20:43
     */
    public Map<String, Object> getPcatInfoByPaIdAndTenIdMap(Map<String, Object> params) {
        return PactMapper.getPcatInfoByPaIdAndTenIdMap(params);
    }

    /**
     * 获取合同的pdf文件url路径 通过合同的编号进行查询
     * @param patId
     * @return
     */
    public JsonResult getPactPDFLink(String patId) {
        String linkUrl = PactMapper.getPDFLinkUrl(patId);
        return JsonResult.success(linkUrl);
    }

}
